﻿using MiniFox.Components;
using MiniFox.Security.Text;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MiniFox.Platform.OAuth2.Providers
{
    /// <summary>
    /// 
    /// </summary>
    [AutoRegister, SpareComponent(typeof(MD5CipherProvider))]
    public interface ICipherProvider
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="password"></param>
        /// <returns></returns>
        Cipher CreateCipher(string password);
    }

    /// <summary>
    /// 
    /// </summary>
    internal class MD5CipherProvider : ICipherProvider
    {
        /// <summary>
        /// 
        /// </summary>
        protected internal MD5CipherProvider()
        {

        }
        #region 加密
        /// <summary>
        /// 默认 MD5Hex 加密
        /// </summary>
        /// <param name="password"></param>
        /// <returns></returns>
        public virtual Cipher CreateCipher(string password)
        {
            MD5HexCipher cipher = password;
            return cipher;
        }

        #endregion

    }
}
